//
//  VerifyPhone.m
//  FMXCocoapods_Example
//
//  Created by wnsj on 2021/9/17.
//  Copyright © 2021 wnsj. All rights reserved.
//

#import "VerifyPhone.h"

@implementation VerifyPhone

+(BOOL)verifyPhone:(NSString *)str
{
    NSError *error = NULL;

        NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$" options:NSRegularExpressionCaseInsensitive error:&error];

        NSTextCheckingResult *result = [regex firstMatchInString:str options:0 range:NSMakeRange(0, [str length])];
    if(result){
        return YES;
    }
    return NO;
}
@end
